

class ConexoesService {

    static transactional = false
    


    // conect ao sis do Sinannet



    def sis () {

         def url = "jdbc:postgresql://172.16.250.1/sis/"


        return  groovy.sql.Sql.newInstance(url,"geolabs","1556210","org.postgresql.Driver")

    }


    def simda(){
         public String tipoDeBanco = Configuracoes.tipoDeBanco()
        def db
        def url
        if (tipoDeBanco == '0') {
             url = "jdbc:postgresql://localhost/postgres/" 
             db =  groovy.sql.Sql.newInstance(url,"postgres","1556210","org.postgresql.Driver")
        }  else {
            if (tipoDeBanco == '1'  ) {
               url = "jdbc:postgresql://172.16.250.1/desenvolvimento"
               db = groovy.sql.Sql.newInstance(url,"geolabs","1556210","org.postgresql.Driver")
            } else {
              if (tipoDeBanco == '2'  ) {
                url = "jdbc:postgresql://172.16.250.1/geolabs/"
                db = groovy.sql.Sql.newInstance(url,"geolabs","1556210","org.postgresql.Driver")
            }
            }
        }
    return db
    }

    def sinan(){
        def  url = "jdbc:postgresql://172.16.250.1/sinannet/"

         return  groovy.sql.Sql.newInstance(url,"geolabs","1556210","org.postgresql.Driver")
    }
}
